<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>一周微信签到记录-云校通-教师</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
<body ontouchstart style="background: #fff;">
	<div class="weui_tab tab-bottom">
		<div class="weui-header bg-blue"> 
	  		<div class="weui-header-left"> <a onclick="back()" class="icon icon-109 f-white">返回</a> </div>
	    	<h1 class="weui-header-title">一周微信签到记录</h1>
	    </div>
		<div class="weui_tab_bd">
	        <div class="weui_cells afterNone afterNoneBefore mt0">
	        	<div class="weui_cell card_sign_box f-15">
	        		<h3 class="f-green">签到记录</h3>
	        	</div>
	        	<div id="signTotal">
	        	</div>
	        </div>
	    </div>
	</div>
<script type="text/javascript">
	$(function() {
		today();
	})
	
	function today() {
		$.ajax({
	   		url: basePath + "/common/work/weekTotal",
	   		type: 'POST',
	   		dataType : "json",
	   		data:{
	   			diffDay: 7
	   		},
	   		success: function(data) {
	   			if(data != null && data.length > 0) {
	   				var html = '',date='';
	   				for(var i in data) {
	   					var itm = data[i];
	   					var currDate = getTime(itm.signTime,'yyyy年MM月dd日');
	   					html+=(date != currDate ? "<div class='weui_cell pl15'>"+currDate+"</div>": "");
	   					html+='<div class="weui_cell afterNone afterNoneBefore">\
						          	<div class="weui_cell_hd">\
				          		<label class="weui_label">'+(itm.signType == 1 ? '上午' : '下午')+'</label>\
				          	</div>\
			         		<div class="weui_cell_bd weui_cell_primary">'+getTime(itm.signTime,'yyyy-MM-dd hh:mm')+'</div></div>';
	   					date = currDate;
	   				}
	   				$("#signTotal").html(html);
	   			}
 	   		},
	   		error: function(data) {
	   		}
		});
	}
	
</script>
</body>
</html>